#ifndef POSITION_H_INCLUDED
#define POSITION_H_INCLUDED
#include <math.h>

struct Position{
float Xpos;
float Ypos;

Position(): Xpos(0), Ypos(0){};

Position(float X, float Y): Xpos(X), Ypos(Y){};


bool operator==(const Position& other) const {
return ((fabs(Xpos- other.Xpos) < 0.00001) && fabs(Ypos- other.Ypos) < 0.00001)  ;
}

bool operator*=(const Position& other) const {
return ((fabs(Xpos -  other.Xpos) < 0.4) && fabs( Ypos -  other.Ypos) < 0.4)  ;
}

bool operator!=(const Position& other) const {
    return !( *this ==other);
  }
//Will by default be used for the comparison operator. Useful to know for Sorting.
bool operator<(const Position& other) const {
    return ( (Xpos < other.Xpos) || (( Xpos < other.Xpos) && Ypos < other.Ypos) );
  }

bool operator>(const Position& other) const {
    return ( (Xpos > other.Xpos) || (( Xpos > other.Xpos) && Ypos > other.Ypos) );
  }

bool operator<=(const Position& other) const {
    return ( *this < other || *this == other );
  }

bool operator>=(const Position& other) const {
    return ( *this > other || *this == other );
  }



Position operator +(const Position& other) const{

     return Position(other.Xpos+ Xpos, other.Ypos + Ypos);
}

};

#endif // POSITION_H_INCLUDED



